<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://unpkg.com/vue@next"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">

      <my-component msg="单独 vue 组件"></my-component>
      
      <!-- :is 动态绑定组件 -->
      <component :is="currentComponent" msg="动态绑定 vue 组件"></component>

    </div>
    <script type="module">
        import { MyComponent } from './js/main.js'
        const app = Vue.createApp({
          setup() {
            const currentComponent = "my-component"
            return {
              currentComponent
            }
          }
        });
        app.component('my-component', MyComponent)
        const vm = app.mount('#app');
    </script>
</body>
</html>